Skip to content

Conversation

@uyarn
Copy link
Collaborator

@uyarn uyarn commented Nov 3, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • fix(Select): 修复 1.15.7 版本中全选功能在分组模式下功能异常的问题

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 3, 2025

tdesign-react-demo

npm i https://pkg.pr.new/tdesign-react@3941

commit: 3088362

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

完成

@RylanBot RylanBot requested a review from Copilot November 3, 2025 12:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the "select all" functionality in grouped Select components. When using option groups with a "checkAll" option, the component now correctly includes options from groups in the calculation of selectable items.

Key Changes

  • Modified the onCheckAllChange function in Select.tsx to handle nested options within option groups
  • Fixed the initial state calculation for the "checkAll" checkbox in Option.tsx
  • Added optional chaining for safe access to options array in the onRemove handler
  • Added a test case to verify the grouped select "checkAll" functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/components/select/base/Select.tsx Updated onCheckAllChange to iterate through grouped options and added safe navigation for options lookup
packages/components/select/base/Option.tsx Fixed initial checkbox state calculation to use optionLength comparison
packages/components/select/tests/select.test.tsx Added test case for grouped select with "checkAll" functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@uyarn uyarn merged commit 8c06843 into develop Nov 4, 2025
8 checks passed
@uyarn uyarn deleted the fix/select-group-checkall branch November 4, 2025 02:50
@github-actions github-actions bot mentioned this pull request Nov 4, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants